package cn.buk.tms.eotms.report.dto;

import cn.buk.common.flight.dto.FlightBasicInfo;
import cn.buk.tms.common.dto.flight.BaseChangeOrderFlightDto;
import cn.buk.tms.eotms.entity.FlightInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 用于报表的机票票号包含的内容
 * @author william
 *
 */
public class ReportFlightTicketDto extends ReportBaseDto {

	public ReportFlightTicketDto(String balanceCode, String ticketNo, Date etdzDate, String passengerName, String routeDetail,
															 double parvalue, double tax, double serviceCharge, double discount, double accountRecv,
															 String op1, Date opDate, int billId, String bePaid0) {
		super(op1,
						opDate,
						billId,
						accountRecv,
						bePaid0 == null ? 0 : Integer.parseInt(bePaid0));

		this.balanceCode = balanceCode;
		this.ticketNo = ticketNo;
		this.etdzDate = etdzDate;
		this.name = passengerName;
		this.routeDetail = routeDetail;

		this.parValue = parvalue;
		this.tax = tax;
		this.serviceCharge = serviceCharge;
		this.discount = discount;
	}

	private final String balanceCode;

	private final String ticketNo;

	/**
	 * 出票日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private final Date etdzDate;

	/**
	 * 乘机人名字
	 */
	private final String name;

	@JsonIgnore
	private final String routeDetail;

	/**
	 * 面价：航司实际销售价
	 */
	private final double parValue;
	/**
	 * 税
	 */
	private final double tax;

	private final double discount;

	private final double serviceCharge;

	private List<FlightBasicInfo> flights;


	public String getBalanceCode() {
		return balanceCode;
	}

	public String getTicketNo() {
		return ticketNo;
	}

	public Date getEtdzDate() {
		return etdzDate;
	}

	public String getName() {
		return name;
	}

	public String getRouteDetail() {
		return routeDetail;
	}

	public double getParValue() {
		return parValue;
	}

	public double getTax() {
		return tax;
	}

	public double getDiscount() {
		return discount;
	}

	public double getServiceCharge() {
		return serviceCharge;
	}

	public List<FlightBasicInfo> getFlights() {
		if (flights == null) {
			flights = new ArrayList<>();
		}
		return flights;
	}
}
